#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void reserve(char* left, char* right)
{
	while (left < right)
	{
		char temp = *right;
		*right = *left;
		*left = temp;
		left++;
		right--;

	}
}
int main()
{
	char a[20] = { 0 };
	gets(a);
	int n = strlen(a);
	char* left = a;
	char* right = a + n - 1;
	reserve(left, right);
	char* cur = a;
	while (*cur)
	{
		char* start = cur;
		char* end = cur;
		while (*end != ' ' && *end != '\0')
		{
			end++;
		}
		reserve(start, end - 1);
		if (end == '\0')
		{
			break;
		}
		else
			cur = end + 1;
	}
	printf("%s", a);
	return 0;
}